package com.baidu.Chapter02;

import java.util.Scanner;

public class ex2_21 {
    public static void main(String[] args) {
        System.out.print("Enter investment amount：");
        Scanner sc=new Scanner(System.in);
        double amount = sc.nextDouble();
        System.out.print("Enter annual interest rate in percentage：");
        double rate = sc.nextDouble();
        System.out.print("Enter number of years：");
        double years = sc.nextDouble();
        double acc=amount * Math.pow((1+rate/1200),years*12);
        System.out.printf("Accumulated value is $%.2f\n",acc);
    }
}
